﻿using System;
using Oxage.Windows.Controls;
using Oxage.Models;

namespace Oxage.Commands
{
	[CommandLineHandler("help", "Displays list of available commands")]
	public class HelpCommandLineHander : ICommandLineHandler
	{
		#region ICommandLineHandler Members
		public void Run(IConsole console, string line, string command, Arguments args)
		{
			console.WriteLine("List of commands:");
			var model = new Oxage.Models.ConsoleViewModel();
			var handlers = model.CommandLineHandlers;
			foreach (var handler in handlers)
			{
				console.WriteLine(string.Format("{0,-20} {1}", handler.Command, handler.Summary));
			}
		}
		#endregion
	}
}
